﻿<div class="blade-static __bottom" ng-include="'$(Platform)/Scripts/common/templates/ok-cancel2.tpl.html'"></div>
<div class="blade-content">
    <div class="blade-inner">
        <div class="inner-block form">
            <div class="form-group">
                <label class="form-label">{{ 'platform.blades.account-api.labels.is-active' | translate }}</label>
                <div class="form-input">
                    <label class="form-label __switch">
                        <input type="checkbox" ng-model="blade.currentEntity.isActive" />
                        <span class="switch"></span>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">{{ 'platform.blades.account-api.labels.key-name' | translate }}</label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.name" placeholder="{{ 'platform.blades.account-api.placeholders.key-name' | translate }}" focus-on>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">
                    {{ 'platform.blades.account-api.labels.key-type' | translate }}
                </label>
                <div class="form-input">
                    <ui-select ng-model="blade.currentEntity.apiAccountType">
                        <ui-select-match placeholder="{{ 'platform.blades.account-api.placeholders.key-type' | translate }}">{{$select.selected}}</ui-select-match>
                        <ui-select-choices repeat="x as x in apiAccountTypes | filter: $select.search">
                            <span ng-bind-html="x | highlight: $select.search"></span>
                        </ui-select-choices>
                    </ui-select>
                </div>
            </div>
            <div class="form-group">
                <label class="form-label">
                    {{blade.currentEntity.apiAccountType===apiAccountTypes[0]?'App ID':'Key'}}
                </label>
                <div class="form-input">
                    <input ng-model="blade.currentEntity.appId" placeholder="{{ 'platform.blades.account-api.placeholders.app-id' | translate }}" readonly>
                </div>
            </div>
            <div class="form-group" ng-if="blade.currentEntity.apiAccountType===apiAccountTypes[0]">
                <label class="form-label">{{ 'platform.blades.account-api.labels.secret-key' | translate }}</label>
                <div class="form-input">
                    <textarea class="form-control" id="secretKey" ng-model="blade.currentEntity.secretKey" placeholder="{{ 'platform.blades.account-api.placeholders.secret-key' | translate }}" readonly></textarea>
                </div>
            </div>
        </div>
    </div>
</div>